#! env sh
cubin_name=`cuobjdump build/torch_grad_test/$1 -lelf | awk '{print $4}'`
cuobjdump build/torch_grad_test/spmm_test -xelf ${cubin_name}
nvdisasm -${1}cfg ${cubin_name} > ${cubin_name}.cfg
dot -Tsvg -o ${cubin_name/.cubin/.svg} < ${cubin_name}.cfg